import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { cameraPatrolTaskCameraVO, cameraPatrolTaskCameraForm, cameraPatrolTaskCameraQuery } from '@/api/camera/camera-patrol-task-camera/types';

/**
 * 查询巡视任务-摄像头列表
 * @param query
 * @returns {*}
 */

export const listcameraPatrolTaskCamera = (query?: cameraPatrolTaskCameraQuery): AxiosPromise<cameraPatrolTaskCameraVO[]> => {
  return request({
    url: '/camera/camera-patrol-task-camera/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询巡视任务-摄像头详细
 * @param cameraPatrolTaskCameraId
 */
export const getcameraPatrolTaskCamera = (cameraPatrolTaskCameraId: string | number): AxiosPromise<cameraPatrolTaskCameraVO> => {
  return request({
    url: '/camera/camera-patrol-task-camera/' + cameraPatrolTaskCameraId,
    method: 'get'
  });
};

/**
 * 新增巡视任务-摄像头
 * @param data
 */
export const addcameraPatrolTaskCamera = (data: cameraPatrolTaskCameraForm) => {
  return request({
    url: '/camera/camera-patrol-task-camera',
    method: 'post',
    data: data
  });
};

/**
 * 修改巡视任务-摄像头
 * @param data
 */
export const updatecameraPatrolTaskCamera = (data: cameraPatrolTaskCameraForm) => {
  return request({
    url: '/camera/camera-patrol-task-camera',
    method: 'put',
    data: data
  });
};

/**
 * 删除巡视任务-摄像头
 * @param cameraPatrolTaskCameraId
 */
export const delcameraPatrolTaskCamera = (cameraPatrolTaskCameraId: string | number | Array<string | number>) => {
  return request({
    url: '/camera/camera-patrol-task-camera/' + cameraPatrolTaskCameraId,
    method: 'delete'
  });
};
